<template>
  <div class="attendances">
    <el-card>
      <div class="content">
        <!-- 左侧 -->
        <div class="left">
          <div class="left-box">
            <i class="el-icon-info"></i>
            <slot name="left">
              <span>有0条考勤审批尚未处理</span>
            </slot>
          </div>
        </div>
        <!--右侧 -->
        <div class="right">
          <slot name="right">
            <el-button size="mini" type="primary">导入</el-button>
            <el-button size="mini" type="primary">提醒</el-button>
            <el-button size="mini" type="primary">设置</el-button>
            <el-button size="mini" type="primary">历史归档</el-button>
            <el-button size="mini" type="primary">3月份报表</el-button>
          </slot>
        </div>
      </div>
      <div class="department">
        <span>部门:</span>
        <template>
          <el-checkbox-group v-model="checkList">
            <el-checkbox
              v-for="(item, index) in deparList"
              :key="index"
              :value="item"
              :label="item.name"
            ></el-checkbox>
          </el-checkbox-group>
        </template></div
    ></el-card>
  </div>
</template>

<script>
import { getDepartmentsApi } from "@/api/departments";
export default {
  data() {
    return {
      showleft: true,
      checkList: [],
      deparList: [],
    };
  },
  methods: {
    async getDepartments() {
      const res = await getDepartmentsApi();

      this.deparList = res.data.depts;
    },
  },
  created() {
    this.getDepartments();
  },
};
</script>

<style lang="scss" scoped>
.attendances {
  margin: 20px;
  .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .left {
      .left-box {
        background-color: #e6f7ff;
        border: 1px solid #c8ebff;
        font-size: 12px;
        padding: 6px;
        i {
          color: #409eff;
          margin-right: 6px;
        }
      }
    }
  }
  .department {
    margin-top: 20px;
    font-size: 14px;
    font-weight: 700;
  }
}
</style>